<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Admin\BaseController;
use App\Http\Requests\Admin\PayAndConsume\HotspotUploadRequest;
use App\Services\PayAndConsume\HotspotService;
use Illuminate\Http\Request;

class HotspotController extends BaseController
{

    public function __construct(HotspotService $hotspotService)
    {
        $this->hotspotService = $hotspotService;
    }

    /**
     * 上传热点数据
     */
    public function upload(HotspotUploadRequest $request)
    {
        $result = $this->hotspotService->create($request);
        if ($result) {
            return returnArr(1, 'success');
        } else {
            return returnArr(-1, '保存数据库失败');
        }
    }
}
